<?php $this->load->view('Import/navbar');?>
<h4><?=$typeName?></h4>
<!-- Tab panes -->
<div class="tab-content" style="margin-top: 10px;">
  <div role="tabpanel" class="tab-pane" id="<?=$focusTag?>">
      <!-- 查询框开始 -->
      <div class="table-responsive">
      <form class="form-inline" method="GET" name="query" id="query">
      <input type="hidden" name="c" id="c" value="<?=$_GET['c']?>">
        <input type="hidden" name="m" id="m" value="<?=$_GET['m']?>">
        <div class="form-group">
          <label for="year">所属年份：</label>
          <select class="form-control" id="year" name="year">
            <option value="">请选择</option>
        </select>
        </div>
        <div class="form-group">
          <label for="timeUnit">所属时间段：</label>
          <select class="form-control" id="timeUnit" name="timeUnit">
            <option value="">请选择</option>
        </select>
        </div>
        <div class="form-group">
          <label for="keyword">关键字：</label>
          <input type="text" class="form-control" name="keyword" id="keyword" value="<?=$keyword?>" placeholder="关键字">
        </div>
        <div class="form-group">
          <button type="submit" class="btn btn-default btn-primary">搜索</button>
          <button type="button" class="btn btn-default" style="width: auto;padding: 0 10px 0 10px;" role="button" onclick="newWindow('导入<?=$typeName?>','<?php echo printUrl('Import','reachTimeUnitAdd', array('year'=>(int)$year,'timeUnit'=>$timeUnit));?>',500,400)">导入<?=$typeName?></button>
        </div>
      </form>
      </div>
      <!-- 查询框结束 -->
      <!-- 表格列表 -->
      <div style="margin-top: 10px;">
      <table class="table table-bordered table-condensed">
        <thead>
          <tr>
            <th class="bg-primary text-center">年份</th>
            <th class="bg-primary text-center">时间段</th>
            <th class="bg-primary text-center">专营店编码</th>
            <th class="bg-primary text-center">专营店名称</th>
            <th class="bg-primary text-center">双月来店量目标</th>
            <th class="bg-primary text-center">导入时间</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($list as $k => $v) {?>
          <tr>
            <td class="text-center"><?=$v['year']?></td>
            <td class="text-center"><?=$v['timeUnitStr']?></td>
            <td class="text-center"><?=$v['coding']?></td>
            <td class="text-center"><?=$v['storeName']?></td>
            <td class="text-center"><?=$v['comeStoreTarget']?></td>
            <td class="text-center"><?=date("Y-m-d H:i:s", $v['createTime'])?></td>
          </tr>
          <?php } ?>
        </tbody>
      </table>
      </div>
      <!-- 分页 -->
      <?=$pager?>
  </div>
</div>
<script type="text/javascript">
$(function(){
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
});
$("#year").change(function(){
    loadTimeUnitList('timeUnit',this.value);
  });
</script>
<?php $this->load->view('Import/foot');?>